package cn.tedu.spring.day01;
 /**
   * 工厂模式---实例工厂
   * 与静态工厂的区别是：构造器不用私有化，没有静态方法
   */
public class NetConnInstanceFactory {

    public NetConnection getInstance(){
        NetConnection nc=new NetConnection();
        nc.load(); nc.ping(); nc.conn();
        return  nc;
    }
     public static void main(String[] args) {
         NetConnInstanceFactory nif=new NetConnInstanceFactory();
         NetConnection nc=nif.getInstance();
         nc.sendData();
     }
}